package com.small.admin.entity;

import com.small.common.util.val.group.ValAdd;
import com.small.common.util.val.group.ValExists;
import com.small.common.util.val.group.ValUpdate;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * 作者: fenny
 * 邮箱: 893146555@qq.com
 * 时间: 2017-10-17 15:28:29
 * 描述: 角色
 */
@Data
@Table(name = "t_role")
public class Role implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotNull(groups = {ValUpdate.class, ValExists.class})
    private Long id;
	
	//角色名称
	@NotEmpty(groups = {ValAdd.class, ValExists.class})
	@Length(max = 30, groups = {ValAdd.class, ValExists.class})
	@Column(name = "name")
    private String name;

	//1是系统角色不允许删除
	@Column(name = "is_system")
	private Integer isSystem;

	//创建时间
	@Column(name = "ctime")
    private Long ctime;

}
